package com.hnjd.config;

import com.hnjd.Filter.LoginFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AppConfig {

    @Bean
    //配置登陆过滤器
    public FilterRegistrationBean registrationBean(){
        FilterRegistrationBean<LoginFilter> loginFilterFilterRegistrationBean = new FilterRegistrationBean<>(new LoginFilter());
        loginFilterFilterRegistrationBean.addUrlPatterns("/*");
        return loginFilterFilterRegistrationBean;
    }
}
